<%inherit file="/demo_base.html" />

<%def name="demo_name()">Audio</%def>

<button id="start">Start play online audio</button>
<div id="info"></div>

<script>
    $('#start').click(function() {
        var player = new Audio();
        player.src = "http://onering-desktop.googlecode.com/hg/media/test.mp3?"+Math.random();
        player.bind('ended', function() {
            $('#info').text("ended");
        });
        player.bind('timeupdate', function() {
            $('#info').text(player.currentTime + "/" + player.duration);
        });
        player.play();
    });
</script>
